package automateWebElements;

import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;

public class PracticeCheckBoxes {
    public static void main(String[] args) {
        FirefoxDriver driver = new FirefoxDriver();
        driver.get("https://rahulshettyacademy.com/AutomationPractice/");
        driver.findElementByXPath("//input[@value='option1']").click();
        Assert.assertTrue(driver.findElementByXPath("//input[@value='option1']").isSelected());
        driver.findElementByXPath("//input[@value='option1']").click();
        Assert.assertFalse(driver.findElementByXPath("//input[@value='option1']").isSelected());


        System.out.println("NR of checkboxes on site: "+ driver.findElementsByCssSelector("input[type='checkbox']").size());


    }
}
